<?php

class GetUserRegisterForm extends Controller
{
	/**
	 * construct function
	 */
	public function __construct()
	{
		parent::__construct();
		header('Cache-Control: no-store, no-cache, must-revalidate');
	}
	
	public function run()
	{
		$this->import('Database');
		$obj_currency = $this->Database->prepare("SELECT * FROM `tl_currency`")
										->execute(time());
		$arr_currency = array();
		while($obj_currency->next()){
			$arr_currency[$obj_currency->iso_code] = $obj_currency->iso_code;
		}
		$select_currency = '<select name="cur">';
		foreach ($arr_currency as $key=>$currency){
			$select_currency .= '<option value="'.$key.'">'.$currency.'</option>';
		}
		$select_currency .= "</select>";
		$str_html = '<p>New to DAFT? </p>
		<h1>CREATE AN ACCOUNT</h1>
		<form enctype="application/x-www-form-urlencoded" method="post" action="sign-in.html" id="signupForm">
			<div class="reg_account">
				<label id="msg_1" style="display:none"><span style="color:green;font-weight:bold;">Your account have been created, and please sign in your account on right side.</span></label>
				<p>
					<label>Email</label><input type="text" id="email" name="email" value="Enter your email" onfocus="if (this.value == \'Enter your email\') {this.value = \'\';}" onblur="if (this.value == \'\'){this.value = \'Enter your email\'; }" class="ce_text" />
					<label id="error_0" class="error" for="email" generated="true" style="display:none">The email address has been registered.</label>
				</p>
				<p>
					<label>Password</label><input type="password" id="password" name="password" value="" class="ce_text" />
				</p>
				<p>
					<label>Confirm Password</label><input type="password" id="confirm_password" name="confirm_password" value="" class="ce_text" />
				</p>
			</div> <!-- reg_account end -->
			<div class="optional">
				<h4>Tell us more about you... (optional)</h4>
				<p>
					<span class="gender"><strong>Gender</strong> <input type="radio" name="gender" value="male" class="checkbox" checked="checked" />M <input type="radio" name="gender" value="female" class="checkbox" />F</span>
					<span class="birthday">
						<strong>Birthday</strong>
						<input type="text" name="birthday" id="datepicker" />
					</span>
					<span class="currency">Choose your preferred currency '.$select_currency.'</span>
				</p>
				<h5>In which city do you spend most of your time in China?</h5>
				<p>
					<select class="most_time" name="province">
						<option selected="selected" value="">Please select province</option>
						<option value="1">Anhui</option>
						<option value="3">Beijing</option>
						<option value="34">Chongqing</option>
						<option value="4">Fujian</option>
						<option value="5">Gansu</option>
						<option value="6">Guangdong</option>
						<option value="7">Guangxi</option>
						<option value="8">Guizhou</option>
						<option value="9">Hainan</option>
						<option value="10">Hebei</option>
						<option value="12">Heilongjiang</option>
						<option value="11">Henan</option>
						<option value="30">HongKong</option>
						<option value="13">Hubei</option>
						<option value="14">Hunan</option>
						<option value="19">Inner Mongolia</option>
						<option value="16">Jiangsu</option>
						<option value="17">Jiangxi</option>
						<option value="15">Jilin</option>
						<option value="18">Liaoning</option>
						<option value="2">Macao</option>
						<option value="20">Ningxia</option>
						<option value="21">Qinghai</option>
						<option value="24">Shaanxi</option>
						<option value="22">Shandong</option>
						<option value="25">Shanghai</option>
						<option value="23">Shanxi</option>
						<option value="26">Sichuan</option>
						<option value="27">Taiwan</option>
						<option value="28">Tianjin</option>
						<option value="29">Tibet</option>
						<option value="31">Xinjiang</option>
						<option value="32">Yunnan</option>
						<option value="33">Zhejiang</option>
					</select>
					<select class="some_time" name="city">
						<option selected="selected" value="">Please select city</option>
					</select>
				</p>
				<h5>Your social networks</h5>
				<p class="social">
					<label><input type="checkbox" name="social_0" value="Facebook" class="checkbox" />Facebook</label>
					<label><input type="checkbox" name="social_1" value="My Space" class="checkbox" />My Space</label>
					<label><input type="checkbox" name="social_2" value="LinkedIN" class="checkbox" />LinkedIN</label>
					<label><input type="checkbox" name="social_3" value="Foursquare" class="checkbox" />Foursquare</label>
					<label><input type="checkbox" name="social_4" value="Twitter" class="checkbox" />Twitter</label>
					<label><input type="checkbox" name="social_5" value="Flickr" class="checkbox" />Flickr</label>
					<label><input type="checkbox" name="social_6" value="Youtube" class="checkbox" />Youtube</label>
					<label><input type="checkbox" name="social_7" value="City Weekend" class="checkbox" />City Weekend</label>
				</p>
			</div> <!-- optional end -->
			<div class="protocol">
				<p class="terms_use"><input type="checkbox" name="term" value="1" /><span>I agree with terms of use.</span></p>
				<p class="gift_ideas"><input type="checkbox" name="newsletter" value="1" /><span>Yes, subscribe me to daft newsletter and receive 10% off my first purchase.</span></p>
			</div>
			<p class="submits"><input type="submit" name="submit" value="CREATE ACCOUNT" class="submit" /></p>
		</form>';
		echo $str_html;
	}
}

$user_form = new GetUserRegisterForm();
$user_form->run();